package com.service.schedule.onecard;

import com.service.external.oncard.SecondDoorsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;

/**
 * 二道门定时任务
 * @author ljz
 */
@Service("SecondDoorsTaskService")
public class SecondDoorsTaskService {

    @Autowired
    SecondDoorsService secondDoorsService;

    /**
     * 读取一卡通数据库，查询出未出厂的司机，并存入CMP数据库,开启门禁权限
     */
    protected void operationArrival() {
        try {
            Map params = new HashMap();
            secondDoorsService.operationArrival(params);
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }
    }
    /**
     * 读取一卡通数据库，查询出已出厂的司机，从CMP数据库删除,删除门禁权限
     *
     * @throws SQLException
     */
    protected void operationLeave() {
        try {
            secondDoorsService.operationLeave();
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }
    }
}
